﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.Text;

namespace WooCoo.Security
{
    public class UserIdentity : IIdentity
    {
        public UserIdentity()
        {
        }
        /// <summary>
        /// 用户会话ID
        /// </summary> 
        public string SessionID { get; set; }
        /// <summary>
        /// 用户ID
        /// </summary>
        public string UserCode { get; set; }
        public string UserName { get; set; }
        /// <summary>
        /// 公司代码
        /// </summary>
        public string CompanyCode { get; set; }

        /// <summary>
        /// 组织代码
        /// </summary>
        public string OrgCode { get; set; }
        /// <summary>
        /// 组织名称
        /// </summary>
        public string OrgName { get; set; }

        #region IIdentity 成员

        public virtual string AuthenticationType
        {
            get { return "WooCoo"; }
        }

        public virtual bool IsAuthenticated
        {
            get { return true; }
        }

        public virtual string Name
        {
            get { return this.UserCode; }
        }

        #endregion
    }
}
